﻿@page "/"
@using CnGalWebSite.Core.Models;
@using CnGalWebSite.Shared
@using CnGalWebSite.DataModel.ViewModel.OperationRecords
@using CnGalWebSite.Shared.MasaComponent.Shared.Tips;
@using Microsoft.AspNetCore.Authentication
@using CnGalWebSite.Extensions

@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@{
    Layout = "_Layout";
    var ip = Request.Headers["X-Forwarded-For"].FirstOrDefault();
    if (string.IsNullOrWhiteSpace(ip))
    {
        ip = Request.HttpContext.Connection.RemoteIpAddress.MapToIPv4().ToString();
    }
    var connectionInfo = new ConnectionInfo()
    {
        RemoteIpAddress = ip
    };

    var mobile = HttpContext.Request.IsMobileBrowser();
}
<component type="typeof(StyleTip)" render-mode="ServerPrerendered" param-Mobile="mobile" />
<component type="typeof(App)" render-mode="ServerPrerendered" param-ConnectionInfo="connectionInfo" param-Mobile="mobile" />
